home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gwuada_5.zip / adaed / gwudemos.doc < prev    next >
Text File  |  1994-01-09  |  3KB  |  97 lines

  1.                GW-Ada/Ed Program Development Environment    
  2.                -----------------------------------------
  3.              Demonstration Programs Supplied with GW-Ada/Ed
  4.                               January 1994
  5.                               
  6.                            Michael B. Feldman
  7.         Department Of Electrical Engineering & Computer Science
  8.                School Of Engineering And Applied Science
  9.                     The George Washington University
  10.                               202-994-5253
  11.                           mfeldman@seas.gwu.edu  
  12.                              
  13. We have included a number of interesting demonstrations to give the user
  14. of the GW-Ada/Ed system a representative sampling of the capabilities of the
  15. system and of Ada in general. You may use these programs for any valid
  16. educational purpose, as long as you acknowledge their authorship. 
  17.  
  18. First, a few relatively simple programs
  19. just to test the compiler and observe programs in execution. First
  20. compile io_libs.ada, then compile, bind, and execute these in the order 
  21. given.
  22.  
  23.   io_libs.ada         -- pre-instantiations of Text_IO packages
  24.                          for predefined types Integer, Float, Boolean
  25.   first.ada           -- a "hello world" program
  26.   fibb.ada            -- recursive Fibonacci numbers
  27.   parser.ada          -- simple recursive-descent expression parser,
  28.                          converting infix expressions to postfix
  29.                          
  30. Next compile a set of reusable packages that will be used in the rest of 
  31. the demos, and which you will find useful for other purposes.
  32.  
  33.   random.ads          -- specification for random number package
  34.   random.adb          -- body
  35.  
  36.   screen.ads          -- specification of simple ANSI screen control
  37.   screen.adb          -- body
  38.  
  39.   windows.ads         -- specification of simple window manager
  40.   windows.adb         -- body
  41.  
  42. Now you can compile and run these two simple demos.
  43.  
  44.   fourpart.ada        -- simple test of screen package
  45.   testwind.ada        -- simple test of windows package
  46.  
  47. Finally we have some programs to demonstrate tasking.
  48. Compile these packages,
  49.  
  50.   screenio.ads        -- specification of protected screen I/O package,
  51.                          for use with concurrent programs
  52.   screenio.adb        -- body
  53.  
  54.   creature.ads        -- specification of creatures for simulation of
  55.                          Unix "worms" game
  56.   creature.adb        -- body
  57.  
  58. then compile and run this program:
  59.  
  60.   worms.ada
  61.  
  62. Now for a simulation of an elevator system. Compile this package
  63.  
  64.   elevator.gen         -- generic package for elevators
  65.  
  66. and then compile and run
  67.  
  68.   elevdemo.ada
  69.  
  70. Last but not least, we have the notorious Dining Philosophers.
  71. We need to compile three more packages:
  72.  
  73.   chop.ads             -- specification for chopsticks
  74.   chop.adb             -- body
  75.  
  76.   phil.ads             -- specification for philosophers
  77.   phil.adb             -- body
  78.  
  79.   room.ads             -- specification for dining room
  80.   room.adb             -- body
  81.  
  82. Now compile, bind, and run
  83.  
  84.   diners.ada
  85.  
  86. and you'll see the philosophers eat. Interrupt the program to quit;
  87. otherwise, it will run for a long time.
  88.  
  89. Finally, we have a version of the philosophers that uses the window
  90. system. Compile an alternative body for the dining room,
  91.  
  92.   roomwind.adb
  93.  
  94. and just re-bind diners. You should see the diners through the windows.
  95.  
  96. Enjoy!
  97.